import 'package:login_model/data/token_data.dart';
import 'package:login_model/model/login_model.dart';
import 'package:login_model/model_center.dart';

/**
 *
 * @ProjectName:    login_model
 * @ClassName:      login_bloc
 * @Description:    dart类作用描述
 * @Author:         孙浩
 * @QQ:             243280864
 * @CreateDate:     2021/1/8 7:33 PM
 */
class LoginBloc {
  String tel, passWord;

  LoginModel _model = LoginModel(LoginModelCenter.instance.dio);
  
  Future loginByPassWord() async {
    TokenData data =await _model.loginByPassowrd(
        LoginData(tel:tel ,pwd: passWord,deviceToken:"AgF6Zj1zyVxGpOz2Zo52z-WzqsWPZzm_mISxtJ-MX8k" ));



    if(data!=null){
      LoginModelCenter.instance.modelRegisterCenter.binToken(data.data.accessToken,data.data.refreshToken);
    }
  }

  void saveName(String name) {
    this.tel = name;
  }

  void savePwd(String pwd) {
    this.passWord = pwd;
  }
}